package com.cet.ej.controller;

import com.cet.ej.utils.SpringUtils;
import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 30952
 */
@RestController
public class OneOffJobController {

//    @Resource(name = "myOneOffJobBean")
//    private OneOffJobBootstrap myOneOffJob;

    @GetMapping("/execute")
    public String execute() {
        OneOffJobBootstrap myOneOffJob = SpringUtils.getBean("myOneOffJobBean");
        myOneOffJob.execute();
        return "ok";
    }
}
